package operator;

/**
 * @author shkstart
 * @date 2022/3/31 - 22:24
 */
/*位运算符操作的都是整型的数据:
<< ：在一定范围内，每向左移1位，相当于 * 2 >>:在一定范围内，每向右移1位，相当于 / 2
*/
public class Bit {
    public static void main(String[] args) {
        int i = 21;
        i = -21;
        int i1 = 8;
        System.out.println("i1 = " + (i1 << 1));
        System.out.println("i << 2 " +(i << 2));
        System.out.println("i << 3 " +(i << 3));
        System.out.println("i << 27 " +(i << 27));


        int m = 12;
        int n = 5;
        System.out.println("m & n : " + (m & n));
        System.out.println("m | n : " + (m | n));
        System.out.println("m ^ n : " + (m ^ n));




    }
}
